{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5ad0a04c-d358-4e20-b760-01207b451b54",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "set_ticks() takes 2 positional arguments but 3 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m/tmp/ipykernel_1301/2209673105.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m     29\u001b[0m     \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0mabs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mn\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mnodes\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     30\u001b[0m     \u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mimshow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minterpolation\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'nearest'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maspect\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'auto'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 31\u001b[0;31m     \u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_yticks\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlabels\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabels\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     32\u001b[0m     \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msetp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_xticklabels\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvisible\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     33\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.8/dist-packages/matplotlib/axes/_base.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m     71\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     72\u001b[0m         \u001b[0;32mdef\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 73\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mget_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     74\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     75\u001b[0m         \u001b[0mwrapper\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__module__\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mowner\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__module__\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mTypeError\u001b[0m: set_ticks() takes 2 positional arguments but 3 were given"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAACBCAYAAADDnAG5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAle0lEQVR4nO3de3xU9Zn48c8zt4SEEEIIGBASEFBQWa5WvBSqCytqxVpUrF21C152e3Nr9ddS/OFuta1dW9q+pFTqqthWsT9X661VS6mIgCJy20iIBIRwTwK5X+fy/P44Z8YhBhKQYRLmeb9eeWXmO+fyfL9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bGD06NEsWrSIqVOnEggE6N27Nxs3bqSyspLKykq2bt2K1+tlzpw5LF++nNraWjIzM7n44ovp3bs306ZNo7CwsFPJTlW59tprefnll48oT09PZ+rUqTQ0NHD99deTk5PDrFmzePXVV7nqqquOmHby5Mns3r2bjz766FN71ifTm2++ybx583j//ffp1asXEydO5Itf/CLnnHMO06ZNQ0QoKipi8eLFPProo6gqI0aM4PHHH2fixIk0NjbG9mYBduzYQXp6Or169eKll15iy5YtrFy5kpUrV5Kfn8/+/fu7X8IXEZ08eTJXX30155xzDh6Ph/T0dEpLSzl48CBZWVm8+OKLlJSUfOq82uzsbDIzMxk+fDhf/vKXmTFjBj6fj+zsbLxe7xE9w66gsrKS7OzshH2pmJOjqamJ6667juzsbJYuXdruNJFIhBdeeIHly5fz/PPP097pxdnZ2QwdOpStW7fG9uqysrLw+/1MnjyZsrIy8vLyuO+++xg4cCAjRoxIaL26u+eee469e/cycuRInnzySV555ZUjTrsMBAJ8/PHHnxoueemll7j22mtZsmQJt9xyy0mJJRKJ0NjYyF/+8heefvpptm3bxp49e+jduzeDBw/mscce4/zzzz/q/NHjf2VlZZSVlcXKR4wYwbnnnsv27dvZvHkzAD6fL3Z/3rS0NAoLC7nwwgtZsmRJ90v4+fn52r9/fzZt2nTM6QYPHkxZWRkTJkzgzjvv5POf/zzDhw/vUgndpKba2lqqq6tJS0sjEAhQWlrKmDFjYl/szc3NRCIR0tPTY0NY5uRoaGjgpz/9KT179uSSSy5h0qRJn5pGVRk1ahS7du3i1ltv5cYbb6S0tJQZM2bEhpLee+898vLyWLNmDfv27ePf/u3fyMjIoEePHrS2trJ48WKKi4uprKykqKiIsrIygsEgra2tAPTq1YvevXuzZs2a4xqfP3DgAI899hhr167lww8/pLKykoaGBvr168ekSZMYMGAA+/fv5+abb8bn83HNNdfE3kPdckgnOoa/Zs0aiouLYwcWa2pqOPfccykoKKBnz57tnklhjDGd8corr3DNNdectOVdeumljB49mosvvphx48Zx9tlnEw6HP9PZdeDsXdbX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LwDnJjejUEZGrgXJV/UBEpiQ5nGS6RFX3ikg/4K8isjX+xUR9DpLdw98LDIp7fqZblioOikg+gPu/3C0/bdtFRPw4yf4PqvqCW5xy7QCgqtXA33GGMHqLSLQDFl/PWBu4r2cDh05tpCfVxcA1IrITWIozrPNLUqf+AKjqXvd/Oc6X/gWcgs9BshP++8Bw9wh9AJgFvJzkmE6ll4Fb3ce34oxpR8tvcY/OXwjUxO3qdVvidOX/GyhW1Z/HvZQy7SAieW7PHhHpgXMMoxgn8c90J2vbBtG2mQksV3cgtztS1e+r6pmqWojzeV+uqjeTIvUHEJFMEcmKPgamAUWcis9BFzh4cSXwEc445g+SHU8C6/kssB8I4ozBzcYZi/wbsA1YBvRxpxWcs5e2A/8LTEh2/CepDS7BGbvcDGx0/65MpXYARgMb3DYoAv6vWz4UWAuUAv8PSHPL093npe7rQ5Ndh5PYFlOAV1Ot/m5dN7l/H0bz3qn4HNilFYwxJkUke0jHGGPMKWIJ3xhjUoQlfGOMSRGW8I0xJkVYwjfGmBRhCd8YY1KEJXxjjEkR/x+5CiXDwhbyHAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#!/usr/bin/env python\n",
    "# -*- coding: utf-8 -*-\n",
    "\n",
    "import os\n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from pywt import WaveletPacket\n",
    "import pywt.data\n",
    "\n",
    "\n",
    "ecg = pywt.data.ecg()\n",
    "\n",
    "wp = WaveletPacket(ecg, 'sym5', maxlevel=4)\n",
    "\n",
    "fig = plt.figure()\n",
    "plt.set_cmap('bone')\n",
    "ax = fig.add_subplot(wp.maxlevel + 1, 1, 1)\n",
    "ax.plot(ecg, 'k')\n",
    "ax.set_xlim(0, len(ecg) - 1)\n",
    "ax.set_title(\"Wavelet packet coefficients\")\n",
    "\n",
    "for level in range(1, wp.maxlevel + 1):\n",
    "    ax = fig.add_subplot(wp.maxlevel + 1, 1, level + 1)\n",
    "    nodes = wp.get_level(level, \"freq\")\n",
    "    nodes.reverse()\n",
    "    labels = [n.path for n in nodes]\n",
    "    values = -abs(np.array([n.data for n in nodes]))\n",
    "    ax.imshow(values, interpolation='nearest', aspect='auto')\n",
    "    ax.set_yticks(np.arange(len(labels) - 0.5, -0.5, -1), labels)\n",
    "    plt.setp(ax.get_xticklabels(), visible=False)\n",
    "\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e6042294-bc4b-4323-a873-7022544ec11b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
